Integrand size = 23, antiderivative size = 89 \[ \int (a+b \tan (e+f x)) (c+d \tan (e+f x))^2 \, dx=-\left (\left (2 b c d-a \left (c^2-d^2\right )\right ) x\right )-\frac {\left (2 a c d+b \left (c^2-d^2\right )\right ) \log (\cos (e+f x))}{f}+\frac {d (b c+a d) \tan (e+f x)}{f}+\frac {b (c+d \tan (e+f x))^2}{2 f} \]
[Out]
Time = 0.09 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3609, 3606, 3556} \[ \int (a+b \tan (e+f x)) (c+d \tan (e+f x))^2 \, dx=-\frac {\left (2 a c d+b \left (c^2-d^2\right )\right ) \log (\cos (e+f x))}{f}-x \left (2 b c d-a \left (c^2-d^2\right )\right )+\frac {d (a d+b c) \tan (e+f x)}{f}+\frac {b (c+d \tan (e+f x))^2}{2 f} \]
[In]
[Out]
Rule 3556
Rule 3606
Rule 3609
Rubi steps \begin{align*} \text {integral}& = \frac {b (c+d \tan (e+f x))^2}{2 f}+\int (c+d \tan (e+f x)) (a c-b d+(b c+a d) \tan (e+f x)) \, dx \\ & = -\left (\left (2 b c d-a \left (c^2-d^2\right )\right ) x\right )+\frac {d (b c+a d) \tan (e+f x)}{f}+\frac {b (c+d \tan (e+f x))^2}{2 f}+\left (2 a c d+b \left (c^2-d^2\right )\right ) \int \tan (e+f x) \, dx \\ & = -\left (\left (2 b c d-a \left (c^2-d^2\right )\right ) x\right )-\frac {\left (2 a c d+b \left (c^2-d^2\right )\right ) \log (\cos (e+f x))}{f}+\frac {d (b c+a d) \tan (e+f x)}{f}+\frac {b (c+d \tan (e+f x))^2}{2 f} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.49 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.08 \[ \int (a+b \tan (e+f x)) (c+d \tan (e+f x))^2 \, dx=\frac {(-i a+b) (c+i d)^2 \log (i-\tan (e+f x))+(i a+b) (c-i d)^2 \log (i+\tan (e+f x))+2 d (2 b c+a d) \tan (e+f x)+b d^2 \tan ^2(e+f x)}{2 f} \]
[In]
[Out]
Time = 0.15 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.01
method | result | size |
norman | \(\left (a \,c^{2}-a \,d^{2}-2 b c d \right ) x +\frac {d \left (a d +2 b c \right ) \tan \left (f x +e \right )}{f}+\frac {b \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {\left (2 a c d +b \,c^{2}-b \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f}\) | \(90\) |
derivativedivides | \(\frac {\frac {b \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\tan \left (f x +e \right ) a \,d^{2}+2 b c d \tan \left (f x +e \right )+\frac {\left (2 a c d +b \,c^{2}-b \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a \,c^{2}-a \,d^{2}-2 b c d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{f}\) | \(97\) |
default | \(\frac {\frac {b \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\tan \left (f x +e \right ) a \,d^{2}+2 b c d \tan \left (f x +e \right )+\frac {\left (2 a c d +b \,c^{2}-b \,d^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a \,c^{2}-a \,d^{2}-2 b c d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{f}\) | \(97\) |
parts | \(a \,c^{2} x +\frac {\left (a \,d^{2}+2 b c d \right ) \left (\tan \left (f x +e \right )-\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}+\frac {\left (2 a c d +b \,c^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {b \,d^{2} \left (\frac {\left (\tan ^{2}\left (f x +e \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}\right )}{f}\) | \(98\) |
parallelrisch | \(\frac {2 x a \,c^{2} f -2 x a \,d^{2} f -4 b c d f x +b \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )+2 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a c d +\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) b \,c^{2}-\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) b \,d^{2}+2 \tan \left (f x +e \right ) a \,d^{2}+4 b c d \tan \left (f x +e \right )}{2 f}\) | \(115\) |
risch | \(i b \,c^{2} x -i b \,d^{2} x +\frac {2 i b \,c^{2} e}{f}+a \,c^{2} x -a \,d^{2} x -2 b c d x -\frac {2 i b \,d^{2} e}{f}+\frac {2 i d \left (a d \,{\mathrm e}^{2 i \left (f x +e \right )}+2 b c \,{\mathrm e}^{2 i \left (f x +e \right )}-i b d \,{\mathrm e}^{2 i \left (f x +e \right )}+a d +2 b c \right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}+2 i a c d x +\frac {4 i a c d e}{f}-\frac {2 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a c d}{f}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) b \,c^{2}}{f}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) b \,d^{2}}{f}\) | \(204\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.02 \[ \int (a+b \tan (e+f x)) (c+d \tan (e+f x))^2 \, dx=\frac {b d^{2} \tan \left (f x + e\right )^{2} + 2 \, {\left (a c^{2} - 2 \, b c d - a d^{2}\right )} f x - {\left (b c^{2} + 2 \, a c d - b d^{2}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 2 \, {\left (2 \, b c d + a d^{2}\right )} \tan \left (f x + e\right )}{2 \, f} \]
[In]
[Out]
Time = 0.11 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.61 \[ \int (a+b \tan (e+f x)) (c+d \tan (e+f x))^2 \, dx=\begin {cases} a c^{2} x + \frac {a c d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} - a d^{2} x + \frac {a d^{2} \tan {\left (e + f x \right )}}{f} + \frac {b c^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 2 b c d x + \frac {2 b c d \tan {\left (e + f x \right )}}{f} - \frac {b d^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {b d^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} & \text {for}\: f \neq 0 \\x \left (a + b \tan {\left (e \right )}\right ) \left (c + d \tan {\left (e \right )}\right )^{2} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.02 \[ \int (a+b \tan (e+f x)) (c+d \tan (e+f x))^2 \, dx=\frac {b d^{2} \tan \left (f x + e\right )^{2} + 2 \, {\left (a c^{2} - 2 \, b c d - a d^{2}\right )} {\left (f x + e\right )} + {\left (b c^{2} + 2 \, a c d - b d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 2 \, {\left (2 \, b c d + a d^{2}\right )} \tan \left (f x + e\right )}{2 \, f} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 811 vs. \(2 (87) = 174\).
Time = 0.66 (sec) , antiderivative size = 811, normalized size of antiderivative = 9.11 \[ \int (a+b \tan (e+f x)) (c+d \tan (e+f x))^2 \, dx=\text {Too large to display} \]
[In]
[Out]
Time = 6.31 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.02 \[ \int (a+b \tan (e+f x)) (c+d \tan (e+f x))^2 \, dx=\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a\,d^2+2\,b\,c\,d\right )}{f}-x\,\left (-a\,c^2+2\,b\,c\,d+a\,d^2\right )+\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {b\,c^2}{2}+a\,c\,d-\frac {b\,d^2}{2}\right )}{f}+\frac {b\,d^2\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2\,f} \]
[In]
[Out]